<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.w3.org/1999/xhtml">
    
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/back/css/font.css">
        <link rel="stylesheet" href="/back/css/xadmin.css">
        <script src="/back/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/back/js/xadmin.js"></script>
        <script>
            layui.table.checkStatus('table1').data;
        </script>
    </head>
    
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">演示</a>
                <a>
                    <cite>导航元素</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">

                        <div class="layui-card-body ">

                                <div class="layui-input-inline layui-show-xs-block">
                                    <input type="text" name="username" placeholder="请输入商品编号" autocomplete="off" class="layui-input" />
                                </div>

                                <div class="layui-input-inline layui-show-xs-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                        <i class="layui-icon">&#xe615;</i></button>
                                </div>

                                <div class="layui-card-body ">
                                    <table class="layui-table layui-form" lay-filter="test">
                                        <thead>
                                            <tr>
                                                <th>商品编号</th>
                                                <th>商品名称</th>
                                                <th>尺寸</th>
                                                <th>类别</th>
                                                <th>单价</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr th:each="goods : ${goodsList}"
                                                th:object="${goods}">
                                                <td th:text="*{goodsId}"></td>
                                                <td th:text="*{goodsName}"></td>
                                                <td th:text="*{goodsSize.goodsSizeName}"></td>
                                                <td th:text="*{category.categoryName}"></td>
                                                <td th:text="*{tradePrice}">/td>
                                                <td class="td-manage">

                                                    <form action="/purchase/cartAdd" method="post">
                                                        <input type="hidden" name="gId" th:value="*{gId}">
                                                        <button type="submit" class="layui-btn layui-btn-normal">添加采购</button>
                                                    </form>

                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="layui-card-body ">
                                    <table class="layui-table layui-form" lay-filter="test">
                                        <thead>
                                        <tr>
                                            <th>商品编号</th>
                                            <th>商品名称</th>
                                            <th>单价</th>
                                            <th>商品数量</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr th:each="c : ${session.purchase_cart}"
                                            th:object="${c}">
                                            <td th:text="*{value.goodsId}"></td>
                                            <td th:text="*{value.goodsName}"></td>
                                            <td th:text="*{value.tradePrice}">/td>
                                            <td>
                                                <a th:href="@{|/purchase/cart_process?gId=*{value.gId}&op=sub|}">-</a>
                                                <input type="text" th:value="*{value.goodsCount}" style="width:30px" class="layui-input" />
                                                <a th:href="@{|/purchase/cart_process?gId=*{value.gId}&op=add|}">+</a>
                                            </td>
                                            <td>
                                                <a th:href="@{|/purchase/cart_process?gId=*{value.gId}&op=delete|}">删除</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><b>总价</b></td>
                                            <td th:text="${session.cartAmount}" colspan="4" style="font-weight: bolder;color: red" ></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>

                            <form class="layui-form layui-col-space5" action="/purchase/purchaseSubmit" method="get">

                                <input type="hidden" name="emp.empId" value="1" />

                                <div class="layui-input-inline layui-show-xs-block">
                                    <select name="supplier.supplierId">
                                        <option value="">供应商</option>
                                        <option th:each="supplier : ${supplierList}"
                                                th:object="${supplier}"
                                                th:value="*{supplierId}"
                                                th:text="*{supplierName}">
                                        </option>
                                    </select>
                                </div>

                                <div class="layui-input-inline layui-show-xs-block">
                                    <select name="warehouse.warehouseId">
                                        <option value="">入库仓库</option>
                                        <option th:each="warehouse : ${warehouseList}"
                                                th:object="${warehouse}"
                                                th:value="*{warehouseId}"
                                                th:text="*{warehouseName}">
                                        </option>
                                    </select>
                                </div>

                                <div class="layui-form-item" style="width:98%;text-align:right;">
                                    <label class="layui-form-label"></label>
                                    <button class="layui-btn layui-btn-lg layui-btn-normal layui-btn-radius" lay-filter="LAY-user-reg-submit" lay-submit="">保存</button>
                                </div>
                            </form>
                        </div>


                        <div class="layui-card-body ">
                            <div class="page">
                                <div>
                                    <a class="prev" href="">&lt;&lt;</a>
                                    <a class="num" href="">1</a>
                                    <span class="current">2</span>
                                    <a class="num" href="">3</a>
                                    <a class="num" href="">489</a>
                                    <a class="next" href="">&gt;&gt;</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <script>
            layui.use(['laydate', 'form'],
            function() {
                var laydate = layui.laydate;

                //执行一个laydate实例
                laydate.render({
                    elem: '#start' //指定元素
                });

                //执行一个laydate实例
                laydate.render({
                    elem: '#end' //指定元素
                });
            });
        </script>
    </body>

</html>